﻿// 文件使用MiniExcel源码， 使用时需遵循其 Apache License 2.0
// 修改摘要通知： 删除异步、Task等net2.0中不支持的内容，替换原先C#自带的zip处理方式，改用yacomp 进行解压缩。
namespace ExcelConfig.Utils
{
    internal static class DateTimeHelper
    {
        /// <summary>
        /// NumberFormat from NuGet ExcelNumberFormat MIT@License
        /// </summary>
        internal static bool IsDateTimeFormat(string formatCode)
        {
            return new ExcelNumberFormat(formatCode).IsDateTimeFormat;
        }

        /**Below Code from ExcelDataReader @MIT License**/
        // All OA dates must be strictly in between OADateMinAsDouble and OADateMaxAsDouble
        private const double OADateMinAsDouble = -657435.0;

        private const double OADateMaxAsDouble = 2958466.0;

        internal static bool IsValidOADateTime(double value)
        {
            return value > OADateMinAsDouble && value < OADateMaxAsDouble;
        }
    }
}
